package com.example.demo.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

@Component
//@RabbitListener(queues = {"duanxin.topic.queue"})
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "duanxin.topic.queue",declare = "true",autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange",
                type = ExchangeTypes.TOPIC),
        key = "#.duanxin.#"
))
public class TopicDuanxinConsumer {
    @RabbitHandler
    public void reviceMessage(String message){
        System.out.println("短信交换机接收到了信息topic："+message);
    }
}
